package sh.action;

import java.io.File;

import sh.service.UploadService;

import com.opensymphony.xwork2.ActionSupport;
import sh.service.impl.UploadServiceImpl;

public class UpLoadInfoAction extends ActionSupport {

	
	private File upFile;
	private String upFileFileName;
	private String upFileContentType;
	
	public String show() throws Exception{
		return "success";
	}
	@Override
	public String execute() throws Exception {
		UploadService test = new UploadServiceImpl();
		if(test.add(upFile)){
		return super.execute();
		}else{
			return "fail";
		}
		//return "success";
	}

	public File getUpFile() {
		return upFile;
	}

	public void setUpFile(File upFile) {
		this.upFile = upFile;
		System.out.println(this.upFile.length()+ "的长度");
		//System.out.println("得到上传文件2");
		System.out.println(this.upFile.length()+ "的长度");
		System.out.println("得到上传文件");
	}

	public String getUpFileFileName() {
		return upFileFileName;
	}

	public void setUpFileFileName(String upFileFileName) {
		this.upFileFileName = upFileFileName;
	}

	public String getUpFileContentType() {
		return upFileContentType;
	}

	public void setUpFileContentType(String upFileContentType) {
		this.upFileContentType = upFileContentType;
	}

}
